#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
int main()
{
    int n, m;
    cin >> n >> m;
    int sum = 0;
    for (int i = 0; i < m; i++)
    {
        int a;
        cin >> a;
        sum += a;
    }
    sum -= (m - 1) * n;
    if (sum <= 0)
        cout << 0;
    else
        cout << sum;
    return 0;
}